package it.gma.torero.operator;

import it.gma.torero.expression.AbstractBooleanExpression;
import it.gma.torero.operand.ComparationOperand;
import it.gma.torero.operand.VariableBinder;
import it.gma.torero.util.Assert;

public abstract class AbstractComparationOperator extends AbstractBooleanExpression {

	protected ComparationOperand operand1;
	protected ComparationOperand operand2;

	public AbstractComparationOperator(ComparationOperand operand1, ComparationOperand operand2) {
		Assert.notNull(operand1);

		Assert.notNull(operand2);
		this.operand1 = operand1;
		this.operand2 = operand2;
	}
	
	
	public boolean isConstant() {
		return false;
	}
	
	
	public void setContext(VariableBinder context) {
		if (operand1 != null) {
		operand1.setContext(context);
		}
		
		if (operand2 != null) {
			operand2.setContext(context);
		}
		
	}

}
